<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"> 

<ui:composition template="/pages/template/template.xhtml">
	<ui:define name="scripts">

	</ui:define>
	<ui:define name="titulo">
		<h:outputText value="#{uploadArquivoMangedBean.titulo}" />
	</ui:define>
	<ui:define name="conteudo">

		<p:dataTable styleClass="tabela_interna" value="#{uploadArquivoMangedBean.tipoTrabalhoSelecionado.listaOpcoesImpressao}" var="opcao" id="tabelaTipoTraballho" emptyMessage="Nenhum Tipo de Trabalho" rowIndexVar="index" >

			<f:facet name="header">
				<h:outputLabel value="Tipo Trabalho             " for="selectTrabalho" />
				<h:selectOneMenu value="#{uploadArquivoMangedBean.idTipoTrabalhoSelecionado}" id="selectTrabalho">
			            <f:selectItem  itemLabel="- Selecione -" itemValue=""/>
			            <f:selectItems value="#{uploadArquivoMangedBean.listaTipoTrabalho}" var="tipoTrabalhoDto" itemLabel="#{tipoTrabalhoDto.tipoTrabalho}" itemValue="#{tipoTrabalhoDto.idTipoTrabalho}"/>
			           	<f:ajax execute="selectTrabalho" render="tabelaTipoTraballho" listener="#{uploadArquivoMangedBean.selecionarTipoTrabalho}" />
			     </h:selectOneMenu>  
			</f:facet>

	        <p:column headerText="Cor">
	            <h:outputText value="#{opcao.cor}" />
	        </p:column>
	
	        <p:column headerText="Quant." >
	            <h:outputText value="#{opcao.quantidade}" />
	        </p:column>
	
	        <p:column headerText="Formato">
	            <h:outputText value="#{opcao.formato}" />
	        </p:column>		

	        <p:column headerText="Papel">
	            <h:outputText value="#{opcao.papel}" />
	        </p:column>		
	        
	        <p:column headerText="G/m²">
	            <h:outputText value="#{opcao.peso}" />
	        </p:column>		
	        
	        <p:column headerText="Descrição" sortBy="#{opcao.descricao}">
	            <h:outputText value="#{opcao.descricao}" />
	        </p:column>		
	        
	        <p:column headerText="Valor" sortBy="#{opcao.valor}">
	            <h:outputText value="#{opcao.valor}" />
	        </p:column>				
	        
	        <p:column width="4%">
		         <p:commandButton id="selectOpcao" icon="ui-icon-search" action="#{uploadArquivoMangedBean.opcaoDetalhamentoComunicacaoVisualSelecionado}">
		         	<f:param name="index" value="#{index}"/>
		         </p:commandButton>  
            </p:column>
	        
		</p:dataTable>
		
	</ui:define>
</ui:composition>
</html>
